package com.card323.crpg.io.msn;

import java.util.Hashtable;

import net.sf.jml.MsnSwitchboard;

public class MSNReceiverManager {
	private MSNReceiverManager() {

	}

	private static class SingletonHolder {
		public static final MSNReceiverManager instance = new MSNReceiverManager();
	}

	public static MSNReceiverManager getInstance() {
		return SingletonHolder.instance;
	}

	public void add_player(String email, MsnSwitchboard b) {

		if (!_hash_board.containsKey(email)) {
			_hash_board.put(email, b);
		}
		if (!_hash_receiver.containsKey(email)) {
			_hash_receiver.put(email, new MSNMessageReceiver());
		}

	}

	Hashtable<String, MsnSwitchboard> _hash_board = new Hashtable<String, MsnSwitchboard>();

	public MsnSwitchboard get_board(String email) {
		return _hash_board.get(email);
	}

	Hashtable<String, MSNMessageReceiver> _hash_receiver = new Hashtable<String, MSNMessageReceiver>();

	public MSNMessageReceiver get_message_receiver(String email) {
		return _hash_receiver.get(email);
	}

}
